/**
 * 
 */
package pl.koziolweb.wfm.client.components;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * <p>
 * [EN]: This class represents a file on browser site.
 * </p>
 * <p>
 * [PL]: Klasa reprezentuje plik po stronie przeglądarki.
 * </p>
 * 
 * @author bartlomiejk
 * 
 */
public class File implements IsSerializable, Comparable<File> {

	private String path;

	private String name;

	private Long size;

	private File parent;

	private boolean directory;

	public File() {
	}

	public File(String path, String name, Long size, File parent,
			boolean directory) {
		this.path = path;
		this.name = name;
		this.size = size;
		this.parent = parent;
		this.directory = directory;
	}

	public String getPath() {
		return path;
	}

	public String getName() {
		return name;
	}

	public Long getSize() {
		return size;
	}

	public File getParent() {
		return parent;
	}

	public boolean isDirectory() {
		return directory;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setSize(Long size) {
		this.size = size;
	}

	public void setParent(File parent) {
		this.parent = parent;
	}

	public void setDirectory(boolean directory) {
		this.directory = directory;
	}

	@Override
	public int compareTo(File o) {
		return this.getName().compareTo(o.getName());
	}

}
